Skip to content

Conversation

@tomeon
Copy link

@tomeon tomeon commented Mar 26, 2025

A sort of companion to LowPowerLab/RaspberryPi-Gateway#48.

This PR adds support for using ATX-Raspi on NixOS (and on distributions using newer kernels and/or without the legacy GPIO interface). Summary of changes:

  1. Add support for libgpiod to both the shell- and Python-based daemon implementations.
  2. Add a NixOS module for enabling the ATX-Raspi GPIO daemon.
  3. Refactor the shell scripts in POSIX sh.
  4. Place the daemon implementations into standalone files.
  5. Add OpenELEC support to shutdownchecksetup.sh and shutdowncheck.sh.
  6. Add support for configuring various GPIO daemon settings via ATX_RASPI_-prefixed environment variables.
  7. Add a GitHub Actions workflow.
  8. Add automatic linting and formatting.
  9. Several other smallish tweaks and fixes.

Thanks in advance for your consideration!

by detecting whether the script in question is already running as root.
via removing non-portable `echo -e` usage and replacing it with a
reusable `header` function.
as `shutdowncheck.sh` is now implemented in POSIX sh.

BREAKING CHANGE: diagnostic messages now use a pretty header, so any
code that relies on the old message format may break.
in addition to supporting `curl`.
or the full source URL, minus script name.
in `shutdowncheck.sh`, as long as the required tools from `libgpiod` are
available.

Additionally, exit with an explicit and informative error message in
case neither the `libgpiod` tools nor the legacy sysfs GPIO interface
are available.
so that we can run actions as a non-root user (needed for flake checks).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant